package cn.com.fuhuitong.main.cart.mode

import cn.com.fuhuitong.http.BaseApiService
import cn.com.fuhuitong.http.BaseResponse
import cn.com.fuhuitong.main.cart.entity.CartIdsEntity
import cn.com.fuhuitong.main.cart.entity.CartListResponse
import io.reactivex.Observable
import retrofit2.http.*

interface CartApi : BaseApiService {

    @GET("/api/goods/shop_cart")
    fun cartList(
        @Header("token") account: String
    ): Observable<CartListResponse>

    @FormUrlEncoded
    @POST("/api/goods/update_shop_cart_num")
    fun cartUpdateNum(
        @Header("token") account: String,
        @Field("shop_cart_id") shopCartId: String,
        @Field("num") num: String
    ): Observable<BaseResponse>

    @POST("/api/goods/del_shop_cart")
    fun cartDelete(
        @Header("token") account: String,
        @Body shopCartIds: CartIdsEntity
    ): Observable<BaseResponse>

}